home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / MPW IIGS Interfaces / CIIGSIncludes / Window.h < prev   
Encoding:
C/C++ Source or Header  |  1990-04-18  |  12.8 KB  |  287 lines  |  [TEXT/MPS ]

  1. /********************************************
  2. ; File: Window.h
  3. ;
  4. ;
  5. ; Copyright Apple Computer, Inc.1986-90
  6. ; All Rights Reserved
  7. ;
  8. ********************************************/
  9. #ifndef __TYPES__
  10. #include <TYPES.h>
  11. #endif
  12.  
  13. #ifndef __QUICKDRAW__
  14. #include <QUICKDRAW.h>
  15. #endif
  16.  
  17. #ifndef __EVENT__
  18. #include <EVENT.h>
  19. #endif
  20.  
  21. #ifndef __CONTROL__
  22. #include <CONTROL.h>
  23. #endif
  24.  
  25. #ifndef __WINDOW__
  26. #define __WINDOW__
  27.  
  28.  
  29. /* Error Codes */
  30. #define paramLenErr 0x0E01  /* first word of parameter list is the wrong size */
  31. #define allocateErr 0x0E02  /* unable to allocate window record */
  32. #define taskMaskErr 0x0E03  /* bits 12-15 are not clear in WmTaskMask field of EventRecord */
  33.  
  34. /* Axis Parameters */
  35. #define wNoConstraint 0x0000  /* No constraint on movement. */
  36. #define wHAxisOnly 0x0001  /* Horizontal axis only. */
  37. #define wVAxisOnly 0x0002  /* Vertical axis only. */
  38.  
  39. /* Desktop Command Codes */
  40. #define FromDesk 0x00  /* Subtract region from desktop */
  41. #define ToDesk 0x1  /* Add region to desktop */
  42. #define GetDesktop 0x2  /* Get Handle of Desktop region */
  43. #define SetDesktop 0x3  /* Set Handle of Desktop region */
  44. #define GetDeskPat 0x4  /* Address of  pattern or drawing routine */
  45. #define SetDeskPat 0x5  /* Change Address of  pattern or drawing routine */
  46. #define GetVisDesktop 0x6  /* Get destop region less visible windows. */
  47. #define BackGroundRgn 0x7  /* For drawing directly on desktop. */
  48.  
  49. /* SendBehind Values */
  50. #define toBottom 0xFFFFFFFEL  /* To send window to bottom. */
  51. #define topMost 0xFFFFFFFFL  /* To make window top. */
  52. #define bottomMost 0x0000L  /* To make window bottom. */
  53.  
  54. /* Task Masks */
  55. #define tmMenuKey 0x00000001L
  56. #define tmUpdate 0x00000002L
  57. #define tmFindW 0x00000004L
  58. #define tmMenuSel 0x0008L
  59. #define tmOpenNDA 0x0010L
  60. #define tmSysClick 0x0020L
  61. #define tmDragW 0x0040L
  62. #define tmContent 0x0080L
  63. #define tmClose 0x0100L
  64. #define tmZoom 0x0200L
  65. #define tmGrow 0x0400L
  66. #define tmScroll 0x0800L
  67. #define tmSpecial 0x1000L
  68. #define tmCRedraw 0x2000L
  69. #define tmInactive 0x4000L
  70. #define tmInfo 0x8000L
  71. #define tmContentControls 0x00010000L
  72. #define tmControlKey 0x00020000L
  73. #define tmControlMenu 0x00040000L
  74. #define tmMultiClick 0x00080000L
  75. #define tmIdleEvents 0x00100000L
  76.  
  77. /* TaskMaster Codes */
  78. #define wNoHit 0x0000  /* retained for back compatibility.  */
  79. #define inNull 0x0000  /* retained for back compatibility */
  80. #define inKey 0x0003  /* retained for back compatibility */
  81. #define inButtDwn 0x0001  /* retained for back compatibility */
  82. #define inUpdate 0x0006  /* retained for back compatibility */
  83. #define wInDesk 0x0010  /* On Desktop */
  84. #define wInMenuBar 0x0011  /* On system menu bar */
  85. #define wClickCalled 0x0012  /* system click called */
  86. #define wInContent 0x0013  /* In content region */
  87. #define wInDrag 0x0014  /* In drag region */
  88. #define wInGrow 0x0015  /* In grow region, active window only */
  89. #define wInGoAway 0x0016  /* In go-away region, active window only */
  90. #define wInZoom 0x0017  /* In zoom region, active window only */
  91. #define wInInfo 0x0018  /* In information bar */
  92. #define wInSpecial 0x0019  /* Item ID selected was 250 - 255 */
  93. #define wInDeskItem 0x001A  /* Item ID selected was 1 - 249 */
  94. #define wInFrame 0x1B  /* in Frame, but not on anything else */
  95. #define wInactMenu 0x1C  /* 'selection' of inactive menu item */
  96. #define wClosedNDA 0x001D  /* desk accessory closed */
  97. #define wCalledSysEdit 0x001E  /* inactive menu item selected */
  98. #define wInSysWindow 0x8000  /* hi bit set for system windows */
  99.  
  100. /* VarCode */
  101. #define wDraw 0x00  /* Draw window frame command. */
  102. #define wHit 0x01  /* Hit test command. */
  103. #define wCalcRgns 0x02  /* Compute regions command. */
  104. #define wNew 0x03  /* Initialization command. */
  105. #define wDispose 0x04  /* Dispose command. */
  106.  
  107. /* WFrame */
  108. #define fHilited 0x0001  /* Window is highlighted. */
  109. #define fZoomed 0x0002  /* Window is zoomed. */
  110. #define fAllocated 0x0004  /* Window record was allocated. */
  111. #define fCtlTie 0x0008  /* Window state tied to controls. */
  112. #define fInfo 0x0010  /* Window has an information bar. */
  113. #define fVis 0x0020  /* Window is visible. */
  114. #define fQContent 0x0040
  115. #define fMove 0x0080  /* Window is movable. */
  116. #define fZoom 0x0100  /* Window is zoomable. */
  117. #define fFlex 0x0200
  118. #define fGrow 0x0400  /* Window has grow box. */
  119. #define fBScroll 0x0800  /* Window has horizontal scroll bar. */
  120. #define fRScroll 0x1000  /* Window has vertical scroll bar. */
  121. #define fAlert 0x2000
  122. #define fClose 0x4000  /* Window has a close box. */
  123. #define fTitle 0x8000  /* Window has a title bar. */
  124.  
  125. /* Other Constants */
  126. #define windSize 0x00D4  /* Size of WindRec. */
  127. #define wmTaskRecSize 0x002E  /* Size of WmTaskRec. */
  128. #define wTrackZoom 0x001F
  129. #define wHitFrame 0x0020
  130. #define wInControl 0x0021
  131. #define wInControlMenu 0x0022
  132. typedef EventRecord WmTaskRec;
  133. typedef EventRecordPtr WmTaskRecPtr;
  134. struct WindColor {
  135.    Word frameColor; /* Color of window frame. */
  136.    Word titleColor; /* Color of title and bar. */
  137.    Word tBarColor; /* Color/pattern of title bar. */
  138.    Word growColor; /* Color of grow box. */
  139.    Word infoColor; /* Color of information bar. */
  140. } ;
  141. typedef struct WindColor WindColor, *WindColorPtr, **WindColorHndl;
  142. struct WindRec {
  143.    struct WindRec *wNext;
  144.    GrafPort port; /* Window's port */
  145.    ProcPtr wDefProc;
  146.    LongWord wRefCon;
  147.    ProcPtr wContDraw;
  148.    LongWord wReserved; /* Space for future expansion */
  149.    RegionHndl wStrucRgn; /* Region of frame plus content. */
  150.    RegionHndl wContRgn; /* Content region. */
  151.    RegionHndl wUpdateRgn; /* Update region. */
  152.    CtlRecHndl wControls; /* Window's control list. */
  153.    CtlRecHndl wFrameCtrls; /* Window frame's control list. */
  154.    Word wFrame;
  155. } ;
  156. typedef struct WindRec WindRec, *WindRecPtr;
  157. struct ParamList {
  158.    Word paramLength; /* Parameter to NewWindow.  */
  159.    Word wFrameBits; /* Parameter to NewWindow. */
  160.    Pointer wTitle; /* Parameter to NewWindow. */
  161.    LongWord wRefCon; /* Parameter to NewWindow. */
  162.    Rect wZoom; /* Parameter to NewWindow. */
  163.    WindColorPtr wColor; /* Parameter to NewWindow. */
  164.    Word wYOrigin; /* Parameter to NewWindow. */
  165.    Word wXOrigin; /* Parameter to NewWindow. */
  166.    Word wDataH; /* Parameter to NewWindow. */
  167.    Word wDataW; /* Parameter to NewWindow. */
  168.    Word wMaxH; /* Parameter to NewWindow. */
  169.    Word wMaxW; /* Parameter to NewWindow. */
  170.    Word wScrollVer; /* Parameter to NewWindow. */
  171.    Word wScrollHor; /* Parameter to NewWindow. */
  172.    Word wPageVer; /* Parameter to NewWindow. */
  173.    Word wPageHor; /* Parameter to NewWindow. */
  174.    LongWord wInfoRefCon; /* Parameter to NewWindow. */
  175.    Word wInfoHeight; /* height of information bar */
  176.    LongProcPtr wFrameDefProc; /* Parameter to NewWindow. */
  177.    VoidProcPtr wInfoDefProc; /* Parameter to NewWindow. */
  178.    VoidProcPtr wContDefProc; /* Parameter to NewWindow. */
  179.    Rect wPosition; /* Parameter to NewWindow. */
  180.    WindowPtr wPlane; /* Parameter to NewWindow. */
  181.    WindRecPtr wStorage; /* Parameter to NewWindow. */
  182. } ;
  183. typedef struct ParamList ParamList, *ParamListPtr, **ParamListHndl;
  184. struct DeskMessageRecord {
  185.    LongWord reserved; /*   */
  186.    Word messageType; /*   */
  187.    Word drawType; /*   */
  188. } ;
  189. typedef struct DeskMessageRecord DeskMessageRecord, *DeskMessageRecordPtr;
  190. extern pascal Word AlertWindow() inline(0x590E,dispatcher);
  191. extern pascal void BeginUpdate() inline(0x1E0E,dispatcher);
  192. extern pascal void BringToFront() inline(0x240E,dispatcher);
  193. extern pascal Boolean CheckUpdate() inline(0x0A0E,dispatcher);
  194. extern pascal void CloseWindow() inline(0x0B0E,dispatcher);
  195. extern pascal Handle CompileText() inline(0x600E,dispatcher);
  196. extern pascal Pointer Desktop() inline(0x0C0E,dispatcher);
  197. extern pascal void DragWindow() inline(0x1A0E,dispatcher);
  198. extern pascal void DrawInfoBar() inline(0x550E,dispatcher);
  199. extern pascal void EndFrameDrawing() inline(0x5B0E,dispatcher);
  200. extern pascal void EndInfoDrawing() inline(0x510E,dispatcher);
  201. extern pascal void EndUpdate() inline(0x1F0E,dispatcher);
  202. extern pascal Word ErrorWindow() inline(0x620E,dispatcher);
  203. extern pascal Word FindWindow() inline(0x170E,dispatcher);
  204. extern pascal WindowPtr FrontWindow() inline(0x150E,dispatcher);
  205. extern pascal void GDRPrivate() inline(0x540E,dispatcher);
  206. extern pascal VoidProcPtr GetContentDraw() inline(0x480E,dispatcher);
  207. extern pascal Long GetContentOrigin () inline(0x3E0E,dispatcher);
  208. extern pascal RegionHndl GetContentRgn() inline(0x2F0E,dispatcher);
  209. extern pascal LongWord GetDataSize() inline(0x400E,dispatcher);
  210. extern pascal LongProcPtr GetDefProc() inline(0x310E,dispatcher);
  211. extern pascal WindowPtr GetFirstWindow() inline(0x520E,dispatcher);
  212. extern pascal void GetFrameColor() inline(0x100E,dispatcher);
  213. extern pascal VoidProcPtr GetInfoDraw() inline(0x4A0E,dispatcher);
  214. extern pascal LongWord GetInfoRefCon() inline(0x350E,dispatcher);
  215. extern pascal LongWord GetMaxGrow() inline(0x420E,dispatcher);
  216. extern pascal WindowPtr GetNextWindow() inline(0x2A0E,dispatcher);
  217. extern pascal LongWord GetPage() inline(0x460E,dispatcher);
  218. extern pascal void GetRectInfo() inline(0x4F0E,dispatcher);
  219. extern pascal LongWord GetScroll() inline(0x440E,dispatcher);
  220. extern pascal RegionHndl GetStructRgn() inline(0x2E0E,dispatcher);
  221. extern pascal Boolean GetSysWFlag() inline(0x4C0E,dispatcher);
  222. extern pascal RegionHndl GetUpdateRgn() inline(0x300E,dispatcher);
  223. extern pascal CtlRecHndl GetWControls() inline(0x330E,dispatcher);
  224. extern pascal Word GetWFrame() inline(0x2C0E,dispatcher);
  225. extern pascal Word GetWKind() inline(0x2B0E,dispatcher);
  226. extern pascal WindowPtr GetWMgrPort() inline(0x200E,dispatcher);
  227. extern pascal LongWord GetWRefCon() inline(0x290E,dispatcher);
  228. extern pascal Pointer GetWTitle() inline(0x0E0E,dispatcher);
  229. extern pascal Ptr GetWindowMgrGlobals() inline(0x580E,dispatcher);
  230. extern pascal Rect *GetZoomRect() inline(0x370E,dispatcher);
  231. extern pascal LongWord GrowWindow() inline(0x1B0E,dispatcher);
  232. extern pascal void HideWindow() inline(0x120E,dispatcher);
  233. extern pascal void HiliteWindow() inline(0x220E,dispatcher);
  234. extern pascal void InvalRect() inline(0x3A0E,dispatcher);
  235. extern pascal void InvalRgn() inline(0x3B0E,dispatcher);
  236. extern pascal void MoveWindow() inline(0x190E,dispatcher);
  237. extern pascal WindowPtr NewWindow() inline(0x090E,dispatcher);
  238. extern pascal WindowPtr NewWindow2() inline(0x610E,dispatcher);
  239. extern pascal Point PinRect() inline(0x210E,dispatcher);
  240. extern pascal void RefreshDesktop() inline(0x390E,dispatcher);
  241. extern pascal void ResizeWindow() inline(0x5C0E,dispatcher);
  242. extern pascal void SelectWindow() inline(0x110E,dispatcher);
  243. extern pascal void SendBehind() inline(0x140E,dispatcher);
  244. extern pascal void SetContentDraw() inline(0x490E,dispatcher);
  245. extern pascal void SetContentOrigin() inline(0x3F0E,dispatcher);
  246. extern pascal void SetContentOrigin2() inline(0x570E,dispatcher);
  247. extern pascal void SetDataSize() inline(0x410E,dispatcher);
  248. extern pascal void SetDefProc() inline(0x320E,dispatcher);
  249. extern pascal void SetFrameColor() inline(0x0F0E,dispatcher);
  250. extern pascal void SetInfoDraw() inline(0x160E,dispatcher);
  251. extern pascal void SetInfoRefCon() inline(0x360E,dispatcher);
  252. extern pascal void SetMaxGrow() inline(0x430E,dispatcher);
  253. extern pascal void SetOriginMask() inline(0x340E,dispatcher);
  254. extern pascal void SetPage() inline(0x470E,dispatcher);
  255. extern pascal void SetScroll() inline(0x450E,dispatcher);
  256. extern pascal void SetSysWindow() inline(0x4B0E,dispatcher);
  257. extern pascal void SetWFrame() inline(0x2D0E,dispatcher);
  258. extern pascal void SetWRefCon() inline(0x280E,dispatcher);
  259. extern pascal void SetWTitle() inline(0x0D0E,dispatcher);
  260. extern pascal FontHndl SetWindowIcons() inline(0x4E0E,dispatcher);
  261. extern pascal void SetZoomRect() inline(0x380E,dispatcher);
  262. extern pascal void ShowHide() inline(0x230E,dispatcher);
  263. extern pascal void ShowWindow() inline(0x130E,dispatcher);
  264. extern pascal void SizeWindow() inline(0x1C0E,dispatcher);
  265. extern pascal void StartDrawing() inline(0x4D0E,dispatcher);
  266. extern pascal void StartFrameDrawing() inline(0x5A0E,dispatcher);
  267. extern pascal void StartInfoDrawing() inline(0x500E,dispatcher);
  268. extern pascal Word TaskMaster() inline(0x1D0E,dispatcher);
  269. extern pascal void TaskMasterContent() inline(0x5D0E,dispatcher);
  270. extern pascal Word TaskMasterDA() inline(0x5F0E,dispatcher);
  271. extern pascal void TaskMasterKey() inline(0x5E0E,dispatcher);
  272. extern pascal Boolean TrackGoAway() inline(0x180E,dispatcher);
  273. extern pascal Boolean TrackZoom() inline(0x260E,dispatcher);
  274. extern pascal void ValidRect() inline(0x3C0E,dispatcher);
  275. extern pascal void ValidRgn() inline(0x3D0E,dispatcher);
  276. extern pascal void WindBootInit() inline(0x010E,dispatcher);
  277. extern pascal LongWord WindDragRect() inline(0x530E,dispatcher);
  278. extern pascal void WindNewRes() inline(0x250E,dispatcher);
  279. extern pascal void WindReset() inline(0x050E,dispatcher);
  280. extern pascal void WindShutDown() inline(0x030E,dispatcher);
  281. extern pascal void WindStartUp() inline(0x020E,dispatcher);
  282. extern pascal Boolean WindStatus() inline(0x060E,dispatcher);
  283. extern pascal Word WindVersion() inline(0x040E,dispatcher);
  284. extern pascal Word WindowGlobal() inline(0x560E,dispatcher);
  285. extern pascal void ZoomWindow() inline(0x270E,dispatcher);
  286. #endif
  287.